<template>
	<view class="content">
		<view class="nav">
			<image src="http://q79q98ocd.bkt.clouddn.com/back.png" @click="toPro()"></image>
			资质中心
		</view>
		<view class="aptitude">
			<xyzTab :tabList="tabList" :tabActiveIdx="tabActiveIdx" @tabSelect="tabSelect" :size="'32upx'"></xyzTab>	
		</view>
		<view class="bgcolor">
			<view  class="submit" v-for="(item,index) in submitLists">
				<image :src="item.img" class="cabbage"></image>
				<view class="pure">{{item.txt}}<view class="defeated" :style="item.title=='重新提交'?'':'display:none'">{{item.deteated}}</view></view>
				<view :class="item.title!=null?'subs':''"  @click="getUrl(item.url)">{{item.title}}</view><!-- :class="index>3?'':'subs'" -->
			</view>
		</view>
	</view>
</template>

<script>
var _thas;
import xyzTab from '@/components/xyz-tab/xyz-tab.vue'
export default {
	components:{
		xyzTab
	},
	data() {
		return {
			tabList: [
				{id: 0,label: '待提交'},
				{id: 1,label: '审核中'},
				{id: 2,label: '审核通过'},
				{id: 3,label: '审核失败'},
			],
			tabActiveIdx: 0,
			submitList:[
				{tabListId:0,img: '/static/img/baicai.png',txt: '纯正有机娃娃菜',title: '提交资质',url: 'tijiaodetails'},
				{tabListId:0,img: '/static/img/baicai.png',txt: '纯正有机娃娃菜',title: '提交资质',url: 'tijiaodetails'},
				{tabListId:1,img: '/static/img/baicai.png',txt: '纯正有机娃娃菜',title: '查看',url: 'shenhedetails'},
				{tabListId:1,img: '/static/img/baicai.png',txt: '纯正有机娃娃菜',title: '查看',url: 'shenhedetails'},
				{tabListId:2,img: '/static/img/baicai.png',txt: '纯正有机娃娃菜',},
				{tabListId:2,img: '/static/img/baicai.png',txt: '纯正有机娃娃菜',},
				{tabListId:3,img: '/static/img/baicai.png',txt: '纯正有机娃娃菜',title: '重新提交',deteated:'证书编号与产品图片不符合'},
				{tabListId:3,img: '/static/img/baicai.png',txt: '纯正有机娃娃菜',title: '重新提交',deteated:'证书编号与产品图片不符合'},
			],
			tabListId:0,
			submitLists:[]
		};
	},
	onLoad:function(){
		_thas=this;
		this.tabSelect();
	},
	methods:{
		tabSelect(e){
			if(e==null){
				e=0;
			}
			_thas.tabListId=e;
			_thas.submitLists=[];
			var len=_thas.submitList.length;
			for (var i=0;i<len;i++) {
				if(_thas.submitList[i].tabListId==e){
					_thas.submitLists.push(_thas.submitList[i]);
					
				}
			}

		},
		getUrl(url){
			uni.navigateTo({
				url:url
			})
		},
		toPro(){
			uni.reLaunch({
				url: '../products'
			});
		},
	}
}
</script>

<style lang="scss">
.content{
	.nav{
		padding: 70upx 0 10upx 0;
		text-align: center;
		position: relative;
		border-bottom: #F00;
		font-size:36upx;
		font-weight:500;
		color: #333;
		image{
			width: 35upx;
			height: 35upx;
			vertical-align: middle;
			position: absolute;
			left: 30upx;
			bottom: 16.5upx;
		}
	}
	.bgcolor{
		background-color: #F7F4F8;
		height: 1400upx;
		.submit{
			padding: 30upx;
			display: flex;
			background-color: #fff;
			margin-bottom: 20upx;
			.cabbage{
				width: 172upx;
				height: 144upx;
				padding-right: 20upx;
			}
			.pure{
				font-size: 30upx;
				color: #333;
				padding-top: 40upx;
				width: 290upx;
				.defeated{
					color: #F40E0E;
					font-size: 24upx;
					padding-top: 10upx;
				}
			}
			.subs{
				width:170upx;
				height:56upx;
				line-height: 56upx;
				background:rgba(85,196,125,1);
				border-radius:5upx;
				font-size:32upx;
				color: #fff;
				text-align: center;	
				margin: 40upx 0 0 35upx;
			}
		}
	}
}
</style>
